<?php

namespace app\common\model;

use think\Model;

class Program extends Model
{
    //更新项目简介
    public function updateDeploy($data){
        $validate = new \app\common\validate\Program();
        if (!$validate->scene('add')->check($data)){
            return $validate->getError();
        }
        $result = $this->where('id',1)->update($data);
        if ($result){
            return 1;
        }else{
            return '修改失败';
        }
    }
    //跟新项目介绍
    public function updateIntro($data){
        $validate = new \app\common\validate\Program();
        if (!$validate->scene('add')->check($data)){
            return $validate->getError();
        }
        $result = $this->where('id',2)->update($data);
        if ($result){
            return 1;
        }else{
            return '修改失败';
        }
    }
}
